package org.ihelpuoo.weboo.tag.ajax;

import javax.servlet.jsp.JspException;

public class EventTag extends SettingTag
{

	private static final long	serialVersionUID	= 2050974936058610716L;

	private String				type;
	private String				to;
	private String				by;

	public String getType()
	{
		return type;
	}

	public void setType(String type)
	{
		this.type = type;
	}

	public String getTo()
	{
		return to;
	}

	public void setTo(String to)
	{
		this.to = to;
	}

	public String getBy()
	{
		return by;
	}

	public void setBy(String by)
	{
		this.by = by;
	}

	public String getContext()
	{
		if (isBlankBody())
			return "null";
		return getBodyStringTrimed();
	}

	@Override
	protected boolean isAvailable()
	{
		return true;
	}

	@Override
	protected void end() throws JspException
	{
		((ViewTag)this.getParent()).addEvent(this);
	}

}
